package com.dfd.store.service.impl;

import com.dfd.store.dao.AdminDao;
import com.dfd.store.dao.UserDao;
import com.dfd.store.domain.Admin;
import com.dfd.store.service.AdminService;
import com.dfd.store.utils.BeanFactory;

/**
 * 管理员的功能接口的实现类
 * 
 * @author DFD
 *
 */
public class AdminServiceImpl implements AdminService {
    AdminDao adminDao = (AdminDao) BeanFactory.getName("AdminDao");

    // 管理员登录
    @Override
    public Admin login(Admin admin) throws Exception {
        Admin admin1 = adminDao.login(admin);
        if (admin1 == null) {
            throw new RuntimeException("帐号密码错误");
        } else {
            return admin1;
        }
    }

}
